<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <%@include file="/static/common/common.jsp" %>
    <script src="/static/js/client/officialClient.js"></script>
    <style>
        .datagrid-cell-check input {
            margin-top: 2px;
        }

        .dialog-form {
            width: 100%;
            height: 100%;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
            padding: 14px 20px;
            justify-content: space-around;
        }

        .dialog-form p {
            display: flex;
            padding-top: 3px;
            padding-bottom: 3px;
            align-items: center;
        }

        .dialog-form .left {
            width: 90px;
        }

    </style>
</head>
<body>

<table id="client_datagrid"></table>

<div id="client_toolbar">
    <a class="easyui-linkbutton" iconCls="icon-bianji iconfont" plain="true" data-cmd="edit">编辑</a>
    <a class="easyui-linkbutton" iconCls="iconfont icon-yijiaozhuchiren" plain="true" data-cmd="exchange">移交客户</a>
    <a class="easyui-linkbutton" iconCls="iconfont icon-shuaxin" plain="true" data-cmd="refresh">刷新</a>
    <p>
        创建日期：<input id="minInputDate" class="easyui-datebox"> ~
        <input id="maxInputDate" class="easyui-datebox">
        精准搜索：<input id="identitynum" class="easyui-textbox" prompt="身份证号">
        <input id="tel" class="easyui-textbox" prompt="电话">
        模糊搜索：<input id="principal" class="easyui-textbox" prompt="负责人"
                    data-options="url:'/employee/selectAll.do',valueField:'id',textField:'username'">
        <input id="keyword" class="easyui-textbox" prompt="客户姓名/邮箱/身份证">
        <a class="easyui-linkbutton" iconCls="iconfont icon-sousuo" plain="true" data-cmd="query">搜索</a>
    </p>
</div>
<div id="form_btns">
    <a class="easyui-linkbutton" iconCls="iconfont icon-dui" plain="true" data-cmd="save">保存</a>
    <a class="easyui-linkbutton" iconCls="iconfont icon-jujue" plain="true" data-cmd="cancel">取消</a>
</div>

<%--弹出框--%>
<div id="client_dialog" class="easyui-dialog">
    <form method="post" class="dialog-form" id="client_form">
        <input type="hidden" name="id" id="clientId">
        <p>
            <span class="left">客户姓名:</span>
            <input name="name" class="easyui-textbox" prompt="请输入客户姓名">
        </p>
        <p>
            <span class="left">年龄:</span>
            <input name="age" class="easyui-numberbox" prompt="请输入年龄">
        </p>
        <p>
            <span class="left">性别:</span>
            <input name="gender" class="easyui-combobox"
                   data-options="valueField:'value',panelHeight:'auto', editable:false,
             data:[{text:'男',value:'1'},{text:'女',value:'0'}]">
        </p>
        <p>
            <span class="left">职业:</span>
            <input name="job" class="easyui-combobox" name="job"
                   data-options="valueField:'name', textField:'name', panelHeight:'auto',
                   url:'/dictionaries/getDictionaries.do?str=job'" />
        </p>
        <p>
            <span class="left">薪资水平:</span>
            <input name="salary" class="easyui-combobox"
                   data-options="valueField:'name', textField:'name',panelHeight:'auto',
                   url:'/dictionaries/getDictionaries.do?str=salaryLevel'" />
        </p>
        <p>
            <span class="left">电话:</span>
            <input name="tel" class="easyui-numberbox" prompt="请输入电话">
        </p>
        <p>
            <span class="left">邮箱:</span>
            <input name="email" class="easyui-textbox" prompt="请输入邮箱">
        </p>
        <p>
            <span class="left">客户地址:</span>
            <input name="address" class="easyui-textbox" prompt="请输入地址">
        </p>
        <p>
            <span class="left">客户来源:</span>
            <input name="source" class="easyui-combobox"
                   data-options="valueField:'name', textField:'name',panelHeight:'auto',
                   url:'/dictionaries/getDictionaries.do?str=customerSource'" />
        </p>
        </p>
        <p>
            <span class="left">QQ:</span>
            <input name="qq" class="easyui-textbox">
        </p>
        <p>
            <span class="left">微信:</span>
            <input name="wechat" class="easyui-textbox">
        </p>
        <p>
            <span class="left">身份证号:</span>
            <input name="identitynum" class="easyui-textbox">
        </p>
    </form>
</div>

<%--移交客户的弹出框--%>
<div id="exchange_dialog" class="easyui-dialog">
    <form method="post" class="dialog-form" id="exchange_form">
        <input type="hidden" name="client.id">
        <input type="hidden" name="oldcharge.id">
        <p>
            <span class="left">需要移交的客户:</span>
            <input name="client.name" class="easyui-textbox" readonly>
        </p>
        <p>
            <span class="left">当前负责人:</span>
            <input name="oldcharge.username" class="easyui-textbox" readonly>
        </p>
        <p>
            <span class="left">要移交给:</span>
            <input name="newcharge.id" class="easyui-combobox"
                   data-options="url:'/employee/selectAll.do',valueField:'id',textField:'username'">
        </p>
        <p>
            <span class="left">移交原因:</span>
            <input name="reason" class="easyui-textbox">
        </p>
    </form>

    <div id="exchange_btns">
        <a class="easyui-linkbutton" iconCls="iconfont icon-dui" plain="true" data-cmd="exchangeSave">确认</a>
        <a class="easyui-linkbutton" iconCls="iconfont icon-jujue" plain="true" data-cmd="cancel">取消</a>
    </div>
</div>

</body>
</html>
